#include <stdio.h>
#include <string.h>

int main() {
	char brr[51] = {0};
	int top = -1;
	char arr[51] = {0};
	scanf("%s", arr);
	int length = strlen(arr);
	int i = 0;
	for (i = 0; i < length; i++) {
		if (arr[i] == '(' || arr[i] == '{' || arr[i] == '[') {
			brr[++top] = arr[i];
		} else if (arr[i] == ')' || arr[i] == '}' || arr[i] == ']') {
			if (top == -1) {
				printf("no");
				return 0;
			}
			char last = brr[top--];
			if ((last == '(' && arr[i] != ')' ) || (last == '{' && arr[i] != '}') || (last == '[' && arr[i] != ']')) {
				printf("no");
				return 0;
			}
		}
	}
	if (top == -1)
		printf("yes");
	else
		printf("no");
	return 0;
}